package com.demo;

import com.alibaba.fastjson.JSON;
import com.google.common.collect.Maps;

import java.util.Map;

/**
 * @author jasper
 */

public enum State {
    /**
     * 小
     */
    SMALL(0), SUPER(1), FIRE(2), CAPE(3);
    /**
     * enum value
     */
    private final int value;
    private final String name="SMALL";

    private State(int value) {
        this.value = value;
    }

    public int getValue() {
        return value;
    }

    public static void main(String[] args) {
        System.out.println(State.SMALL.getValue());
        System.out.println(State.SMALL.value);
        System.out.println(State.valueOf("SMALL"));
        System.out.println(State.valueOf(State.class, "SUPER"));
        System.out.println();

        Map<String,Integer> maps = Maps.newHashMap();
        maps.put("a",1);
        maps.put("b",2);
        maps.put("c",3);
        maps.put("d",4);

        System.out.println(JSON.toJSON(maps).toString());
    }
}
